{include file="public/css"}
{include file="public/js"}
<form class="layui-form" action="" style="padding:20px;background:#fff">
  <input  type="hidden" name="from" value="{$Request.param.from}"> 
  <input  type="hidden" name="to" value="{$Request.param.to}">
  <input  type="hidden" name="role" value="{if $user.uid == $order['buyer_uid']}0{elseif $user.uid == $order['seller_uid']}1{/if}">
  <input  type="hidden" name="oid" value="{$Request.param.id}">
 {:token()}
  <div class="layui-form-item">
    <label class="layui-form-label">维权类型</label>
    <div class="layui-input-inline" style="width:300px;">
      <select name="type" lay-verify="required">
        <!-- 买家维权 -->
        {if $user.uid == $order['buyer_uid']}
        <option value="2">卖家违规</option>
        {else}
        <option value="1">买家违规</option>
        {/if}

        {/if}
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">具体原因</label>
    <div class="layui-input-inline" style="width:300px;">
      <textarea name="content" placeholder="请输入具体违规内容"  lay-verify="required" class="layui-textarea"></textarea>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">上传图片</label>
    <div class="layui-input-block">
    {:upload_images('上传图片','image_url')}
</button>
    </div>
  </div>
   <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn layui-btn-normal" lay-submit lay-filter="form">立即提交</button>
    </div>
  </div>
</form>

<script>
layui.use(['form','layer','upload'], function(){
	var form = layui.form;
  var upload = layui.upload;

// 表单提交
form.on('submit(form)', function(data){
  $.post("{:url('@user/rights/index')}",data.field,function(json){
       if(json.code==0){
         layer.msg(json.msg);

window.parent.location.reload();
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
      
       }else{
       	 layer.msg(json.msg);
       }
  });
  return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
});


});
</script>